import { S } from '../s';
import { IPSControlRender } from './ipscontrol-render';
import { IPSLayoutPanel } from './panel/ipslayout-panel';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSControlRenderProxy
  extends PSModelObjectImpl
  implements IPSControlRender
{
  get layoutPanelModel(): string {
    return this.M.layoutPanelModel;
  }

  get name(): string {
    return this.M.name;
  }

  protected pslayoutpanel: IPSLayoutPanel;
  getPSLayoutPanel(): IPSLayoutPanel | null {
    return (
      this.pslayoutpanel ||
      (this.pslayoutpanel = this.fillObjectModel(
        S._255,
        this.M.getPSLayoutPanel,
        S._30d,
      ) as IPSLayoutPanel)
    );
  }

  get renderName(): string {
    return this.M.renderName;
  }

  get renderType(): 'LAYOUTPANEL' | 'LAYOUTPANEL_MODEL' | 'PFPLUGIN' {
    return this.M.renderType;
  }
  get cls(): string {
    return 'PSControlRenderProxy';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3f6) return true;
    return super.instanceof(cls);
  }
}
